<%@page import="com.test.objects.Author"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>mypage-posts</title>
	<link rel="stylesheet" type="text/css" href="./css/template.css" />
</head>
<body onload="setFocus();">
<%@ include file="/WEB-INF/jsp/main/header.jsp" %>
<%
	page = request.getParameter("page") != null ? 
			request.getParameter("page") : "posts";
%>

<table cellpadding="0" cellspacing="0" border="0" width=100%><tr><td align="center">

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#4682B4" width="800px">
	<tr><td>
		<table cellpadding="0" cellspacing="1" width="100%" border="0">
		<tr><td class="welcome" valign="top" colspan="2" align="left">
			welcome
			<% 
			if (session.getAttribute("author") != null){
				Author author = (Author)session.getAttribute("author");
				out.print("<a href=\"user.m?id="+ author.getId() + "\">" + 
						"<font color=\"#ffffff\">" + author.getFullname() + "</font></a>!");
			}else{
				out.print("<a href=\"login.m\"><font color=\"#ffffff\">guest</font></a>!");
			}
			%>
		</td></tr>
		<tr><td valign="top" bgcolor="#FFFFFF" width="135">
			<%@ include file="/WEB-INF/jsp/main/left_menu.jsp" %>
		</td>
		<td valign="top" bgcolor="#FFFFFF" width="100%">
		
<% if (page == null || page.equals("posts") || 
	   page.equals("posts-cat") || page.equals("posts-author")){ %>		
	<%@ include file="/WEB-INF/jsp/modules/posts.jsp" %>
<% }else if (page.equals("post-view")){ %>
	<%@ include file="/WEB-INF/jsp/modules/post-view.jsp" %>
<% }else if (page.equals("post-input")){ %>
	<%@ include file="/WEB-INF/jsp/modules/post-input.jsp" %>
<% }else if (page.equals("post-update")){ %>
	<%@ include file="/WEB-INF/jsp/modules/post-update.jsp" %>
<% } %>
		</td></tr>
	</table>
	</td></tr>
</table>

</td></tr></table>


<%@ include file="/WEB-INF/jsp/main/footer.jsp" %>
</body>
</html>